<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->

<lv-form class="formGroup">
  <lv-form-item>
    <lv-form-label>{{'common_name_label'|i18n}}</lv-form-label>
    <lv-form-control>{{data.name | nil}}</lv-form-control>
  </lv-form-item>
  <lv-form-item>
    <lv-form-label>{{'common_copy_data_label'|i18n}}</lv-form-label>
    <lv-form-control>
      {{data.copyDataSelectionPolicy | textMap: 'CopyData_Selection_Policy'}}
    </lv-form-control>
  </lv-form-item>
  <lv-form-item>
    <lv-form-label>{{'common_scheduled_label'|i18n}}</lv-form-label>
    <lv-form-control>
      <ng-container *ngIf="data.schedulePolicy === schedulePolicy.AfterBackupDone">
        <span>
          {{'explore_after_backup_done_label'|i18n}}
        </span>
      </ng-container>
      <ng-container *ngIf="data.schedulePolicy === schedulePolicy.PeriodSchedule">
        {{schedulePolicyLabel}}
      </ng-container>
    </lv-form-control>
  </lv-form-item>
  <lv-form-item>
    <lv-form-label>{{'common_retention_label'|i18n}}</lv-form-label>
    <lv-form-control>
      <ng-container [ngSwitch]="data.retentionPolicy">
        <ng-container *ngSwitchCase="retentionPolicy.Permanent">
          {{'explore_permanent_retention_label'|i18n}}
        </ng-container>
        <ng-container *ngSwitchCase="retentionPolicy.LatestOne">
          {{'explore_always_latest_label'|i18n}}
        </ng-container>
        <ng-container *ngSwitchCase="retentionPolicy.FixedTime">
          {{'common_retention_label'|i18n}}{{spaceLabel}}
          {{data.retentionValue}}{{spaceLabel}}
          {{data.retentionUnit | textMap:'Interval_Unit'}}
        </ng-container>
        <ng-container *ngSwitchDefault>
          --
        </ng-container>
      </ng-container>
    </lv-form-control>
  </lv-form-item>
  <lv-form-item>
    <lv-form-label>{{'explore_account_of_object_label'|i18n}}</lv-form-label>
    <lv-form-control>
      {{data.liveMountCount | nil}}
    </lv-form-control>
  </lv-form-item>
</lv-form>

<ng-template #headerTpl>
  <aui-custom-modal-operate [item]='data'></aui-custom-modal-operate>
</ng-template>
